package com.si.store.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.si.store.R;
import com.si.store.model.GamesAndApps;

public class SuggestAdapter extends ArrayAdapter<GamesAndApps> {
	private List<GamesAndApps> list;
	private Context context;
	private LayoutInflater inflater;
	public SuggestAdapter(Context ctx,List<GamesAndApps> objects) {
		super(ctx, 0, objects);
		this.list=objects;
		this.context=ctx;
		this.inflater= (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder= new ViewHolder();
		if(convertView==null){
			convertView=inflater.inflate(R.layout.item_suggest, parent, false);
			holder.tvSuggest=(TextView)convertView.findViewById(R.id.tv_suggest);
			convertView.setTag(holder);
			
		}else{
			holder=(ViewHolder)convertView.getTag();
		}
		GamesAndApps model= list.get(position);
		
		holder.tvSuggest.setText(model.getDowlaod());
		return convertView;
	}
	class ViewHolder {
		private TextView tvSuggest;
	}

	
}
